home *** CD-ROM | disk | FTP | other *** search
- /*
- File: DictList.h
-
- Contains: Definition of class DictionaryList
-
- Owned by: Richard Rodseth
-
- Copyright: © 1993 - 1995 by Apple Computer, Inc., all rights reserved.
-
- */
-
- #ifndef _DICTLIST_
- #define _DICTLIST_
-
- #ifndef _ODTYPES_
- #include "ODTypes.h"
- #endif
-
- #ifndef _PLFMDEF_
- #include "PlfmDef.h"
- #endif
-
- #ifndef _LINKLIST_
- #include "LinkList.h"
- #endif
-
- //==============================================================================
- // Theory of Operation
- //==============================================================================
-
- // OrdereCollection is an ordered collection of elements of type void* (since
- // we can't use templates)
- // Duplicates are allowed.
-
- //==============================================================================
- // Constants
- //==============================================================================
-
- //==============================================================================
- // Scalar Types
- //==============================================================================
-
- typedef void* KeyType;
- typedef void* ValueType;
-
- //=====================================================================================
- // Classes defined in this interface
- //=====================================================================================
-
- class DictionaryList;
-
- //=====================================================================================
- // Classes used by this interface
- //=====================================================================================
-
- class Association; // Defined in implementation
-
- //=====================================================================================
- // Global Variables
- //=====================================================================================
-
-
- //=====================================================================================
- // Class DictionaryList
- //=====================================================================================
-
- class DictionaryList
- {
-
-
- public:
-
- DictionaryList();
- virtual ~DictionaryList();
-
- ODVMethod void AddPair(KeyType key, ValueType value);
-
- ODVMethod ODULong Count();
- ODVMethod ODBoolean ContainsKey(KeyType key);
- ODVMethod ValueType ValueAtKey(KeyType key);
-
- ODVMethod void RemoveKey(KeyType key);
- ODVMethod void RemoveAll();
- ODVMethod void DeleteKeys();
- ODVMethod void DeleteValues();
- ODVMethod void DeleteSOMValues();
-
- protected:
-
- ODVMethod Association* CreateNewAssociation(KeyType key, ValueType value) const;
- ODVMethod ODBoolean KeysMatch(KeyType key1,KeyType key2) const;
-
- // Does a straight == comparison by default
-
- private:
-
- LinkedList fImplementation;
- };
-
- #endif // _DICTLIST_
-